import {Component, OnInit} from '@angular/core';
import {PageVo} from '../../entity/page-vo';
import {PageVoService} from '../../service/page-vo.service';
import {DocService} from '../../service/doc.service';
import {SimpleUser} from '../../entity/simple-user';

@Component({
    selector: 'app-crumb',
    templateUrl: './crumb.component.html',
    styleUrls: ['./crumb.component.css']
})
export class CrumbComponent implements OnInit {
    pageVo: PageVo;

    owners: SimpleUser[];

    constructor(private pageVoService: PageVoService,
                private docService: DocService) {
    }

    ngOnInit() {
        this.pageVoService.currentPageVo.subscribe((pageVo: PageVo) => this.pageVo = pageVo);


        this.pageVoService.ownerObservable.subscribe((owners: SimpleUser[]) => {
            this.owners = owners;
        });
    }
}
